package shiyi.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import shiyi.service.MyService;

@Configuration   // 定义该类是一个配置类
public class MyConfig {
    @Bean("myService1")// 将返回值对象作为组件添加到Spring容器中，该组件id默认为方法名
    public MyService myService(){
        return new MyService();
    }
}

